var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
  default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_scroll_view_uniapp_sfc = require("./scroll-view.uniapp-sfc.css");
var import_vue = require("vue");
var import_utils = require("../utils");
var import_helper = require("./helper");
var import_vue2 = require("vue");
const __vue_sfc__ = (0, import_vue.defineComponent)({
  name: (0, import_utils.createNamespace)("ScrollView")[0],
  options: {
    // https://uniapp.dcloud.io/matter.html#mp
    virtualHost: true
  },
  props: import_helper.scrollViewProps,
  emits: import_helper.scrollViewEmits,
  setup(props) {
    const theStyle = (0, import_vue.computed)(() => {
      const { customStyle, width, height, maxHeight, scrollX, enableFlex } = props;
      let style = "";
      if (width)
        style += `width:${(0, import_utils.transformSize)(width)};`;
      if (height)
        style += `height:${(0, import_utils.transformSize)(height)};`;
      if (maxHeight)
        style += `max-height:${(0, import_utils.transformSize)(maxHeight)};`;
      if (scrollX)
        style += `white-space:nowrap;`;
      if (enableFlex)
        style += "display:flex;";
      return (0, import_utils.transformStyleSize)(customStyle) + style;
    });
    return { theStyle };
  }
});
const _hoisted_1 = {
  key: 0,
  class: "fan-scroll-view--flexin"
};
function __vue_render__(_ctx, _cache) {
  const _component_scroll_view = (0, import_vue2.resolveComponent)("scroll-view");
  return !_ctx.scrollable && _ctx.enableFlex ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
    "div",
    {
      key: 0,
      class: "fan-scroll-view fan-scroll-view--flex",
      style: (0, import_vue2.normalizeStyle)(_ctx.theStyle)
    },
    [
      (0, import_vue2.renderSlot)(_ctx.$slots, "default")
    ],
    4
    /* STYLE */
  )) : ((0, import_vue2.openBlock)(), (0, import_vue2.createBlock)(_component_scroll_view, {
    key: 1,
    class: "fan-scroll-view",
    style: (0, import_vue2.normalizeStyle)(_ctx.theStyle),
    "scroll-x": _ctx.scrollX,
    "scroll-y": _ctx.scrollY,
    "scroll-with-animation": _ctx.scrollWithAnimation,
    "enable-back-to-top": _ctx.enableBackToTop,
    "upper-threshold": _ctx.upperThreshold,
    "lower-threshold": _ctx.lowerThreshold,
    "scroll-top": _ctx.scrollTop,
    "scroll-left": _ctx.scrollLeft,
    "enable-flex": _ctx.enableFlex,
    "show-scrollbar": false,
    onScroll: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("scroll", $event)),
    onScrolltolower: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("scrolltolower")),
    onScrolltoupper: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("scrolltoupper"))
  }, {
    default: (0, import_vue2.withCtx)(() => [
      _ctx.enableFlex && _ctx.scrollX && _ctx.scrollable ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("div", _hoisted_1, [
        (0, import_vue2.renderSlot)(_ctx.$slots, "default")
      ])) : (0, import_vue2.renderSlot)(_ctx.$slots, "default", { key: 1 })
    ]),
    _: 3
    /* FORWARDED */
  }, 8, ["style", "scroll-x", "scroll-y", "scroll-with-animation", "enable-back-to-top", "upper-threshold", "lower-threshold", "scroll-top", "scroll-left", "enable-flex"]));
}
__vue_sfc__.render = __vue_render__;
var stdin_default = __vue_sfc__;
